package com.tkjt.pms.calc.core;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tkjt.pms.calc.CalcDataUpdater;
import com.tkjt.pms.calc.common.IndexCalcParallel;
import com.tkjt.pms.common.IndexParam;
import com.tkjt.pms.modules.common.mapper.PMSCommonMapper;
import com.tkjt.pms.persist.dao.KpiIndexDao;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Service
public class CalcDataUpdaterImpl implements CalcDataUpdater {
	
	@Autowired
	private KpiIndexDao kpiIndexDao;
	@Autowired
	PMSCommonMapper commonMapper;
	@Override
	public void doUpdater(IndexParam indexParam, IndexCalcParallel indexCalcParallel, Map<String, Double> datas) {
		
		log.info("calc data updater...\r\nindexCalcParallel={}\r\ndatas={}", indexCalcParallel,datas);
		
		kpiIndexDao.updateIndexValues(indexCalcParallel, datas);
	
		log.info("upate calc value successfully.");
	}

}
